/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ConnectMySQLServer;

import com.mysql.jdbc.Connection;
import java.sql.DriverManager;


/**
 *
 * @author CUONGTROC
 */
public class ConnectionDatabase {
    private Connection conn;
    public ConnectionDatabase(){
    }
    public Connection getConnection() throws Exception{
        try {
            Class.forName("com.mysql.jdbc.Driver");
            conn = (Connection) DriverManager.getConnection("jdbc:mysql://localhost/hiredbooks?user=root&password=123");
            return conn;
        } catch (Exception ex) {
            throw ex;
        }
    }
}
